import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/api/login/',
    method: 'post',
    data
  })
}

export function getInfo() {
  return request({
    url: '/api/system/user/user_info/',
    method: 'get'
  })
}

// export function logout() {
//   return request({
//     url: '/vue-element-admin/user/logout',
//     method: 'post'
//   })
// }


/*------get员工数据--------*/
export function getUserData(query) {
  return request({
    url: '/api/system/user/',
    method: 'get',
    params: query
  })
}

/*------add员工数据--------*/
export function addUserData(data) {
  return request({
    url: '/api/system/user/',
    method: 'post',
    data
  })
}
/*------edit员工数据--------*/
export function editUserData(obj) {
  return request({
    url: '/api/system/user/'+obj.id+'/',
    method: 'put',
    data:obj
  })
}
/*------delete员工数据--------*/
export function delUserData(pk) {
  return request({
    url: '/api/system/user/'+pk+'/',
    method: 'delete',
  })
}
/*------重置员工密码员工数据--------*/
export function resetUserPassword(pk) {
  return request({
    url: '/api/system/user/reset_to_default_password/'+pk+'/',
    method: 'put',
  })
}

